package com.itheima.reggie.common;

public class UserHolder {
    private static ThreadLocal<Long> threadlocal = new ThreadLocal<>();

    /**
     * 设置id
     *
     * @param id
     */
    public static void set(Long id) {
        threadlocal.set(id);
    }

    /**
     * 获取id
     */
    public static Long get(){

        return threadlocal.get();
    }

    /**
     * 移除
     */
    public static void remove() {

        threadlocal.remove();
    }
}
